cities={
    'New York':'USA',
    'Tokyo':'Japan',
    'Paris':'France',
}

for city, country in cities.items():
    print(f'{city} is in {country}')



sentence='hello world hello python world'
words = sentence.split()
word_count = {}
for word in words:
    if word in word_count:
        word_count[word]+=1
    else:
        word_count[word]=1
print(word_count)


favorite_numbers = {
    'Alice': 7,
    'Bob': 12,
    'Charlie': 3,
}
print(f'用户最喜欢的数字是{favorite_numbers.get('Charlie','未记录')}')
print(f'用户最喜欢的数字是{favorite_numbers.get('David','未记录')}')
print(f'用户最喜欢的数字是{favorite_numbers.get('tom','未记录')}')
print(f'用户最喜欢的数字是{favorite_numbers.get('frank','未记录')}')
print(f'用户最喜欢的数字是{favorite_numbers.get('h','未记录')}')


students = {
    'Alive':[85,90,78],
    'Bob':[76,88,92],
    'Charlie':[90,95,89],
}

for name, scores in students.items():
    average = sum(scores) / len(scores)
    print(f"{name}'s average score us {average:.2f}")
new_name = input("Enter student name: ")
new_scores = input("Enter scores (somma-aeparated)").split(',')
new_scores = [int(score) for score in new_scores]
students[new_name] = new_scores
print('Updated sudents:',students)